<div class="container-fluid" style="padding: 20px 10px 0px 10px">
    <div class="row-fluid">
        <div class="well">
            <ul class="nav nav-tabs">
                <li class="active"><b>导出EXCEL表格</b> <span style="color:red"> * 默认最近三天的数据</span></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane active in" id="home">
                    <form id="formid" action="/order/exportexcel" method="post">
                        <!--<p>-->
                            <!--<label style="display: inline;margin-left: 15px">订单状态：</label>-->
                            <!--<select style="width: 164px" name="order_status">-->
                                <!--<option value="all">全部</option>-->
                                <!--<option value="time">待发货</option>-->
                                <!--<option value="time">已完成</option>-->
                                <!--<option value="time">待收货</option>-->
                            <!--</select>-->
                        <!--</p>-->
                        <!--<p>-->
                        <!--<label style="display: inline;margin-left: 15px">导出方式：</label>-->
                        <!--<select style="width: 164px">-->
                            <!--<option value="all">全部</option>-->
                            <!--<option value="time">时间段</option>-->
                        <!--</select>-->
                        <!--</p>-->
                        <p class="time" style="display: block;">
                            <label style="display: inline;margin-left: 15px">起始时间：</label>
                            <input name="dotime" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd HH:mm"})' readonly style="width:210px" type="text" value="<?=I('get.dotime') ?: date('Y-m-d H:i',time()-24*3600*3)?>" />
                        </p>
                        <p class="time" style="display: block;">
                            <label style="display: inline;margin-left: 15px">结束时间：</label>
                            <input name="endtime" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd HH:mm"})' readonly style="width:210px" type="text" value="<?=I('get.dotime') ?:  date('Y-m-d H:i')?>" />
                        </p>
                        <input type="hidden" value="1" name="dosubmit" />
                    </form>
                </div>
                <div class="btn-toolbar">
                    <button class="btn btn-primary" style="margin-left:90px" id="btn-save">确认导出</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $('#btn-save').click(function() {
            var doTime = new Date($('input[name="dotime"]').val()).getTime();
            var endTime = new Date($('input[name="endtime"]').val()).getTime();
            if (!$('input[name="dotime"]').val()) {
                showmsg('请选择起始时间');
                return false;
            } else if (!$('input[name="endtime"]').val()) {
                showmsg('请选择结束时间');
                return false;
            } else if (doTime>endTime) {
                showmsg('请选择正确的时间段  ');
                return false;
            }else{
                $('#formid').submit();
//                var param = {};
//                param['dosubmit'] = $('input[name="dosubmit"]').val();
//                param['dotime'] = $('input[name="dotime"]').val();
//                param['endtime'] = $('input[name="endtime"]').val();
//                $.post('/order/exportexcel',param,function(data){
//                    showmsg(data.msg);
//                },'json');
            }
        });
    });
</script>